package com.itheima_04;


import java.util.Random;

//  奇偶数判断：判断一个数是奇数还是偶数
public class isEvenNumber {
    public static void main(String[] args) {
        System.out.println("获取一个1-100的随机整数如下：");
        Random r = new Random();
        int num = r.nextInt(100)+1;
        System.out.println("num:" + num);
        EvenNumber(num);
    }

    private static void EvenNumber(int num) {
        if (num % 2 == 0) {
            System.out.println("整数" + num + "是偶数。");
        } else {
            System.out.println("整数" + num + "是奇数。");
        }
    }
}
